Shader "HPipeline/HUnlit"
{
    Properties
    {
        _Color("Color",Color) = (1,1,1,1)
        _MainTex("Texture", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType" = "Opaque" }
        Cull off
        LOD 300

        Pass
        {
            // The value of the LightMode Pass tag must match the ShaderTagId in ScriptableRenderContext.DrawRenderers
            Tags { "LightMode" = "HUnlit"}

            HLSLPROGRAM

            #pragma enable_cbuffer
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityShaderVariables.cginc"
            //#include "Packages/com.unity.render-piplines.core/ShaderLibrary/Common.hlsl"
            //#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"

            cbuffer H_Light
            {
                fixed4 _Color;
            };
            
            //float4x4 unity_MatrixVP;
            //float4x4 unity_ObjectToWorld;

            struct Attributes
            {
                float4 positionOS   : POSITION;
                float2 texC : TEXCOORD0;
            };

            struct Varyings
            {
                float4 positionCS : SV_POSITION;
                float2 texC : TEXCOORD0;
            };

            UNITY_DECLARE_TEX2D(_MainTex);

            Varyings vert (Attributes IN)
            {
                Varyings OUT;
                OUT.positionCS = mul(UNITY_MATRIX_MVP, IN.positionOS);
                OUT.texC = IN.texC;
                return OUT;
            }

            half4 frag (Varyings IN) : SV_TARGET
            {
                return UNITY_SAMPLE_TEX2D(_MainTex, IN.texC);
            }
            ENDHLSL
        }

        Pass
        {
            Tags { "RenderType" = "Opaque"  "LightMode" = "HVisibilityPass"}
            ZWrite On

            HLSLPROGRAM
            #pragma multi_compile_instancing
            #include "../ShaderLibrary/VBuffer/visibilityPass.hlsl"

            #pragma vertex vert
            #pragma fragment frag

            ENDHLSL
        }
    }
    Fallback "HUnlit"
}
